package com.jinlia.show.modules.base.constant;

import com.fasterxml.jackson.annotation.JsonFormat;

@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum DataBoardTypeEnum {
    DATA_ORDER(10, "dateOrder","日订单"), DATA_PAY(11, "datePay","日收款"),
    WAIT_CONFIRM(12, "waitConfirm","待接单"), PART_REFUND(13, "waitDelivery","待配送"),
    ALL_REFUND(14, "onWay","在途中"), ALL_REFUND2(15, "deliveryComplete","已完成"),
    ALL_REFUND3(16, "unKnow","未知");
    public final Integer value;
    public final String type;
    public final String text;

    /**
     * @param value
     * @param text
     */
    DataBoardTypeEnum(Integer value, String type, String text) {
        this.value = value;
        this.text = text;
        this.type = type;
    }

    @Override
    public String toString() {
        return "DataBoardTypeEnum{" +
                "value=" + value +
                ", text='" + text + '\'' +
                '}';
    }

    public static DataBoardTypeEnum getByValue(int value) {
        for (DataBoardTypeEnum temp : DataBoardTypeEnum.values()) {
            if (temp.value == value) {
                return temp;
            }
        }
        return ALL_REFUND3;
    }
}
